#include"rtenv.h"

enum SYMBOL_TYPE{
    SYMBOL_UNKOWN,
    SYMBOL_FUNCTION,
    SYMBOL_STRUCT,
    SYMBOL_SPECIFIER,
    SYMBOL_VOID,
    SYMBOL_INT
};

#define SYMBOL_TABLE_DEFAULT_SIZE 373

typedef struct sym_entry_ * sym_entry;
typedef sym_entry * sym_entries;

typedef struct sym_entry_{
    char * sym;
    struct {
        int type;
        int size;
        rtenv_access access;
        char * ssym;
        void * table;
    } sym_info;
    sym_entry next;
}sym_entry_;

typedef struct sym_table_ * sym_table;

typedef struct sym_table_{
    sym_table  pre;
    int size;
    sym_entries entrise;
}sym_table_;

unsigned int sym_str_hash(char *str);
sym_table init_sym_table(sym_table pre,int size);
sym_entry init_int_entry(char *sym);
sym_entry init_void_entry(char *sym);
sym_entry init_function_entry(char *sym,int rtype);
sym_entry init_specifier_entry(char *sym,sym_table table);
sym_entry init_struct_entry(char *sym,char *ssym);
sym_entry insert_sym_entry(sym_table table,sym_entry entry);
sym_entry lookup_sym_entry(sym_table table,char * sym,int global);
